package org.xxx.epms.admin.dto;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.xxx.epms.admin.models.AdminDetails;
import org.xxx.epms.admin.models.AdminPermission;

import java.util.List;

@Getter
@Setter
@NoArgsConstructor
public class AdminDetailsDto {

    private String adminCode;

    private String adminPassword;

    private List<AdminPermission> adminResourcesList;

    public AdminDetailsDto(String adminCode, String adminPassword, List<AdminPermission> adminResourcesList) {
        this.adminCode = adminCode;
        this.adminPassword = adminPassword;
        this.adminResourcesList = adminResourcesList;
    }

    public AdminDetailsDto(AdminDetails adminDetails) {
        this.adminCode = adminDetails.getUsername();
        this.adminPassword = adminDetails.getPassword();
        this.adminResourcesList = adminDetails.getAdminResourcesList();
    }
}
